﻿<UserControl x:Class="DBDocumenter.UserControls.UCDatabaseInformation"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:DBDocumenter.Helper"
    xmlns:rc="clr-namespace:DBDocumenter.Resources"
    mc:Ignorable="d"
    MinHeight="350" Width="600" Loaded="UserControl_Loaded">
    <DockPanel>

        <Grid x:Name="grdDBWelcome" DockPanel.Dock="Top" Height="350" Width="600" Visibility="Collapsed" >
            <TextBlock Foreground="White" FontWeight="Bold" Width="500" TextWrapping="WrapWithOverflow" TextAlignment="Center" Text="{x:Static rc:PLResources.Welcome_Screen_Text}" FontSize="40" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        </Grid>
        
        <Grid x:Name="grdDBInformation" DockPanel.Dock="Top" Height="350" Width="600" Visibility="Collapsed" >
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                
                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin ="50,0,50,0" >
                    <Label Name="lblDBInformationHeader" HorizontalAlignment="Center" FontWeight="Bold" VerticalAlignment="Center" Content="{x:Static rc:PLResources.Plese_fill_Database_server_information}" Style="{DynamicResource Label_Style}" Margin="10,10,30,10"/>
                </StackPanel>
                
                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin ="50,0,50,0" >
                    <Label Name="lblServer" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{x:Static rc:PLResources.Server}" Style="{DynamicResource Label_Style}" Margin="10,10,30,10"/>
                    <TextBox HorizontalAlignment="Center" VerticalAlignment="Center" Text="" Name="txtServerName" Width="400"/>
                </StackPanel>
                
                <StackPanel  Grid.Row="2" Orientation="Horizontal" Margin ="50,0,50,0">
                    <CheckBox HorizontalAlignment="Center" Checked="chkIntegratedSecurity_Checked" Unchecked="chkIntegratedSecurity_Unchecked" VerticalAlignment="Center" Name="chkIntegratedSecurity" Content="{x:Static rc:PLResources.Integrated_Security}" Style="{DynamicResource CheckBox_Style}" Margin="10,10,10,10" />
                </StackPanel>

                <StackPanel  Grid.Row="3" Orientation="Horizontal" Margin ="50,0,50,0">
                    <Label HorizontalAlignment="Center" VerticalAlignment="Center" Content="{x:Static rc:PLResources.UserID}" Name="lblUserName" Style="{DynamicResource Label_Style}" Margin="10,10,28,10"/>
                    <TextBox HorizontalAlignment="Right" VerticalAlignment="Center" Text="" Name="txtUserName" Width="400"/>
                </StackPanel>

                <StackPanel  Grid.Row="4" Orientation="Horizontal" Margin ="50,0,50,0">
                    <Label HorizontalAlignment="Center" VerticalAlignment="Center" Content="{x:Static rc:PLResources.Password}" Name="lblPassword" Style="{DynamicResource Label_Style}" Margin="10,10,10,10"/>
                    <PasswordBox HorizontalAlignment="Center" VerticalAlignment="Center" Name="txtPassword" Width="400" />
                </StackPanel>
                    <!--<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Margin ="50,10,50,10">-->
                <UniformGrid  Grid.Row="5" Columns="2" Margin ="50,0,50,0">
                    <StackPanel Orientation="Vertical" x:Name="dataBaseStackPanel" Visibility="Hidden">
                        <Label HorizontalAlignment="Center" VerticalAlignment="Center" Content="{x:Static rc:PLResources.Choose_Database}" Style="{DynamicResource Label_Style}" Margin="5,5,5,5"/>
                        <ComboBox IsReadOnly="True" Name="cmbDatabase" Width="150" Height="30" SelectionChanged="cmbDatabase_SelectionChanged"  Margin="5,5,5,5">
                        </ComboBox>
                    </StackPanel>
                    <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Margin ="0,0,10,0">
                    <Button Name="btnConnect" Click="BtnConnect_Click" Width="150" Template="{DynamicResource ButtonControlTemplate}" Height="32">
                        <StackPanel Margin="0,0,0,0" Orientation="Horizontal" Opacity="0.895" >
                            <Image HorizontalAlignment="Left" Height="25" Width="25" Source="/Resources/Images/Connect.png"  />
                            <TextBlock Text="{x:Static rc:PLResources.Connect_to_server}"  Width="150" Style="{DynamicResource ButtonText_Style}" Margin="0,0,8,0" VerticalAlignment="Center" TextAlignment="Left" HorizontalAlignment="Left" TextWrapping="WrapWithOverflow"  />
                        </StackPanel>
                    </Button>
                    <Button Click="BtnDisConnect_Click" Visibility="Collapsed" Name="btnDisConnect" Width="150" Template="{DynamicResource ButtonControlTemplate}" Height="32">
                        <StackPanel Margin="0,0,0,0" Orientation="Horizontal" Opacity="0.895" >
                            <Image HorizontalAlignment="Left" Height="25" Width="25" Source="/Resources/Images/Connect.png"  />
                            <TextBlock Text="{x:Static rc:PLResources.Disconnect_Server}"  Width="150" Style="{DynamicResource ButtonText_Style}" Margin="0,0,8,0" VerticalAlignment="Center" TextAlignment="Left" HorizontalAlignment="Left" TextWrapping="WrapWithOverflow"  />
                        </StackPanel>
                    </Button>
                    </StackPanel>
                    </UniformGrid>
                <!--</StackPanel>-->
            </Grid>
        </Grid>
        
        <Grid x:Name="grdDBComponent" DockPanel.Dock="Top" Height="350" Width="600" Visibility="Collapsed">
            <UniformGrid Rows="3" Columns="2">

                <StackPanel Orientation="Horizontal" Margin ="50,10,50,10">
                    <CheckBox IsChecked="True" HorizontalAlignment="Center" VerticalAlignment="Center" Name="chkDatabases" Content="{x:Static rc:PLResources.ChkDatabases}" Style="{DynamicResource CheckBox_Style}" Margin="10,10,10,10" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin ="50,10,50,10">
                    <CheckBox IsChecked="True" HorizontalAlignment="Center" VerticalAlignment="Center" Name="chkTables" Content="{x:Static rc:PLResources.ChkTables}" Style="{DynamicResource CheckBox_Style}" Margin="10,10,10,10" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin ="50,10,50,10">
                    <CheckBox IsChecked="True" HorizontalAlignment="Center" VerticalAlignment="Center" Name="chkViews" Content="{x:Static rc:PLResources.ChkViews}" Style="{DynamicResource CheckBox_Style}" Margin="10,10,10,10" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin ="50,10,50,10">
                    <CheckBox IsChecked="True" HorizontalAlignment="Center" VerticalAlignment="Center" Name="chkStoredProcedure" Content="{x:Static rc:PLResources.ChkStored_Procedures}" Style="{DynamicResource CheckBox_Style}" Margin="10,10,10,10" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" Margin ="50,10,50,10">
                    <CheckBox IsChecked="True" HorizontalAlignment="Center" VerticalAlignment="Center" Name="chkFunctions" Content="{x:Static rc:PLResources.ChkFunctions}" Style="{DynamicResource CheckBox_Style}" Margin="10,10,10,10" />
                </StackPanel>
                
            </UniformGrid>
        </Grid>

        <Grid x:Name="grdDBSummary" DockPanel.Dock="Top" Height="350" Width="600" Visibility="Collapsed">
            <StackPanel Orientation="Vertical">
                <Label FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Center" Content="{x:Static rc:PLResources.Please_select_folder_where_you_want_to_keep_document}" Style="{DynamicResource Label_Style}" Margin="0,10,0,10"/>
                <TreeView x:Name="foldersItem" Height="245" Width="600"
                    Style="{DynamicResource TreeView_Style}" SelectedItemChanged="foldersItem_SelectedItemChanged" Background="Transparent" BorderBrush="#FFFFFFFF" Foreground="#FFFFFFFF" Margin="0,10,0,10">
                    <TreeView.Resources>
                        <Style TargetType="{x:Type TreeViewItem}">
                            <!--<Style.Resources>
                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
                                         Color="Transparent"/>
                            </Style.Resources>-->
                            <Setter Property="HeaderTemplate">
                                <Setter.Value>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Name="img"  Width="20" Height="20" Stretch="Fill" 
                                       Source="{Binding 
                                       RelativeSource={RelativeSource 
                                       Mode=FindAncestor, 
                                       AncestorType={x:Type TreeViewItem}}, 
                                       Path=Header, 
                                       Converter={x:Static local:HeaderToImageConverter.Instance}}"       
                                       />
                                            <TextBlock Text="{Binding}" Margin="5,0" FontSize="13" Foreground="White"  />
                                        </StackPanel>
                                    </DataTemplate>
                                </Setter.Value>
                                
                            </Setter>
                            <!--<Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Yellow"/>
                                </Trigger>
                            </Style.Triggers>-->
                        </Style>
                        
                    </TreeView.Resources>
                </TreeView>
                <Button Name="btnGenerate" HorizontalAlignment="Right" Click="BtnGenerate_Click" Template="{DynamicResource ButtonControlTemplate}" Height="32">
                    <StackPanel Margin="0,0,0,0" Orientation="Horizontal" Opacity="0.895" >
                        <Image HorizontalAlignment="Left" Height="25" Width="25" Source="/Resources/Images/Save.png"  />
                        <TextBlock Text="{x:Static rc:PLResources.Generate_Document}"  Width="150" Style="{DynamicResource ButtonText_Style}" Margin="0,0,8,0" VerticalAlignment="Center" TextAlignment="Left" HorizontalAlignment="Left" TextWrapping="WrapWithOverflow"  />
                    </StackPanel>
                </Button>
                <!--<ProgressBar x:Name="pbWait" Height="22" IsIndeterminate="False" Maximum="100" Minimum="0" Background="LightBlue" Foreground="#FF44080B" />-->
            </StackPanel>
        </Grid>
    </DockPanel>
</UserControl>
